package ouyangye.person;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {

        System.out.println("机器人");
        Robot robot = new Robot(80, "01");
        robot.work();
        robot.eat();
        robot.sleep();
        robot.charge();

        System.out.println("\n人");
        Human human = new Human("张三");
        human.work();
        human.eat();
        human.sleep();
        human.charge();


        System.out.println("\n猪");
        Pig pig = new Pig("粉色");
        pig.work();
        pig.eat();
        pig.sleep();
        pig.charge();

        Action[] a = new Action[]{robot,human,pig};
        for (Action action : a){
            action.work();
            action.eat();
            action.sleep();
            action.charge();
        }
    }
}